<script setup>
import {ref} from "vue";
import qs from "qs";

const order=ref({
  "id": 3,
  "subject": "学茶订单AA",
  "totalAmount": 297
})
// const loginInfo={token:'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MywidXNlcm5hbWUiOiJxaWxlaSIsInJlbW90ZUFkZHIiOiIwOjA6MDowOjA6MDowOjEiLCJ1c2VyQWdlbnQiOiJNb3ppbGxhLzUuMCAoTWFjaW50b3NoOyBJbnRlbCBNYWMgT1MgWCAxMF8xNV83KSBBcHBsZVdlYktpdC81MzcuMzYgKEtIVE1MLCBsaWtlIEdlY2tvKSBDaHJvbWUvMTE5LjAuMC4wIFNhZmFyaS81MzcuMzYifQ.65Vtx_grgXhK0CwRfIep6CReOGKO9nDrM7I9ftA2Qog'}
const pay=(order)=> {
  let url = 'http://localhost:39282/alipay/pay';
  let params = {
    outTradeNo: order.id, subject: '学茶商城订单支付', totalAmount: order.totalAmount
  }
  window.open(url + '?' + qs.stringify(params));
}
</script>

<template>
  <h1>这是支付页面</h1>
  <el-button type="primary" @click="pay(order)">支付</el-button>
</template>
<style scoped>

</style>